<template>
  <div id="rent-analysis"></div>
</template>

<script setup>
import { onMounted } from 'vue';
import * as echarts from 'echarts';

const initChart = () => {
  const chartDom = document.getElementById('rent-analysis');
  const myChart = echarts.init(chartDom);
  const option = {
    color: ['#5470C6', '#91CC75', '#EE6666', '#FAC858', '#73C0DE', '#3BA272', '#FC8452', '#9A60B4', '#EA7CCC'],
    title: {
      text: '租金水平分析'
    },
    tooltip: {},
    xAxis: {
      type: 'category',
      data: ['区域1', '区域2', '区域3', '区域4', '区域5']
    },
    yAxis: {
      type: 'value'
    },
    series: [{
      data: [3000, 4000, 3500, 5000, 4500],
      type: 'line'
    }]
  };

  myChart.setOption(option);
};

onMounted(() => {
  initChart();
});
</script>

<style scoped>
#rent-analysis {
  width: 100%;
  height: 100%;
}
</style> 